<template>
    <el-pagination
        class="mt20"
        background
        @next-click="handleNextClick"
        @prev-click="handlePrevClick"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page.sync="pageNow"
        :page-size="pageSize"
        layout="prev, pager, next, jumper"
        :total="total">
    </el-pagination>
</template>

<script>
    export default {
        data() {
            return {
                pageNow: 1
            }
        },
        props: {
            pageSize: {
                type: Number,
                default: 20
            },
            total: {
                type: Number
            },
        },
        methods: {
            handleNextClick(val) {
                this.$emit('handleNextClick',val)
            },
            handlePrevClick(val) {
                this.$emit('handlePrevClick',val)
            },
            handleSizeChange(val) {
                this.$emit('handleSizeChange',val)
            },
            handleCurrentChange(val) {
                this.$emit('handleCurrentChange',val)
            },
        }
    }
</script>

<style scoped>

</style>